

-include buildtype.mk
BSP_DIR				 = $(EXTERN_RELEASE_DIR)/bsp/Ares_Mediabox_V2
TARGET				 = _ARES
MEM_CONFIG           = 8mx2
USERCFLAGS			 =   -DAML_ATHENA -DAML_DIR -DTV_MODE_720P -DAML_MEDIA_BOX_V1 -DSUPPORT_RM  -DAML_VERSION -DSUPPORT_KEYBOARD -DENABLE_CARD_READER -I$(BSP_DIR) 
#USERCFLAGS			 =   -DAML_ATHENA -DAML_DIR -DAML_MEDIA_BOX_V1 -DSUPPORT_RM  -DAML_VERSION -DWISTAR_VERSION -I$(BSP_DIR) 

export BSP_DIR  
export USERCFLAGS
libs   +=  cardreader.lib \
        dma.lib \
        app_rm.lib \
        ntfs.lib
       		
LIBS += $(libs:%.lib=-l%)	

BASE_OUT_NAME=app$(TARGET)
include $(EXTERN_RELEASE_DIR)/makefiles/avos.common
export BASE_OUT_NAME
all: syslibs
	@echo BUILDTYPE=$(BUILDTYPE) >buildtype.mk
	$(MAKE) -C ../src $(BUILDTYPE)
	

dbg dbgburner rom romburner: syslibs
	@echo BUILDTYPE=$(BUILDTYPE) >buildtype.mk
	$(MAKE) -C ../src $@
syslibs clean:
	@echo BUILDTYPE=$(BUILDTYPE) >buildtype.mk
	$(MAKE) -C ../src $@
down:
	scarc -jtag $(TARGETDIR)/$(BASE_OUT_NAME).out -OK
offdown:
	scarc -jtag -off=download $(TARGETDIR)/$(BASE_OUT_NAME).out -OK
prom:
	scarc -jtag  -hmem=0x2800000 $(TARGETDIR)/$(BASE_OUT_NAME).burn.elf -OK
debugrom_down:
	scarc -jtag $(TARGETDIR)/debugromburner.burn.elf
debugrom:
	$(MAKE) -C ../src $@
cleanall:
	rm -rf buildtype.mk *_bld
